package com.example.apple.ddhr_new.utils;

import android.content.Context;

/**
 * @author DELL
 * @date 2018/11/21
 */
public class ScreenUtil
{
    public static  int dp2px(Context context, float dpValue){
        float scale=context.getResources().getDisplayMetrics().density;
        return (int)(dpValue*scale+0.5f);
    }
    public static  int px2dp(Context context, float pxValue){
        float scale=context.getResources().getDisplayMetrics().density;
        return (int) (pxValue / scale + 0.5f);
    }
}
